﻿<UserControl x:Class="FirstFloor.ModernUI.App.Pages.DpiAwareness"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:mui="http://firstfloorsoftware.com/ModernUI"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <Grid Style="{StaticResource ContentRoot}">
        <ScrollViewer>
            <StackPanel >
                <TextBlock Text="DPI AWARENESS" Style="{StaticResource Heading1}" Margin="0,0,0,8"/>
                <mui:BBCodeBlock Margin="0,0,0,32" xml:space="preserve">Windows 8.1 gives developers new functionality to create desktop applications that are per-monitor DPI-aware. MUI automatically enables per-monitor DPI awereness when supported by the host OS. When enabled a window is scaled across monitors of different DPIs.
                    
MUI's implementation of per-monitor DPI awareness is largely based on the MSDN article [url=http://msdn.microsoft.com/en-us/library/windows/desktop/ee308410(v=vs.85).aspx]Developing a Per-Monitor DPI-Aware WPF Application[/url].</mui:BBCodeBlock>

                <TextBlock Text="DPI INFORMATION" Style="{StaticResource Heading2}"/>
                <mui:BBCodeBlock BBCode="{Binding DpiAwareMessage}" Margin="0,0,0,16" />
                <Grid>
                    <Grid.Resources>
                        <Style x:Key="RightAlign" TargetType="TextBlock">
                            <Setter Property="HorizontalAlignment" Value="Right" />
                            <Setter Property="Margin" Value="16,0,0,4" />
                        </Style>
                    </Grid.Resources>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="Auto"/>
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition />
                        <RowDefinition />
                        <RowDefinition />
                        <RowDefinition />
                    </Grid.RowDefinitions>

                    <TextBlock Text="WPF rendering DPI:" />
                    <TextBlock Grid.Column="1" Text="{Binding WpfDpi}" Style="{StaticResource RightAlign}" />
                    <TextBlock Grid.Row="1" Text="Current monitor DPI:" />
                    <TextBlock Grid.Row="1" Grid.Column="1" Text="{Binding MonitorDpi}" Style="{StaticResource RightAlign}" />
                    <TextBlock Grid.Row="2" Text="Layout scale:" />
                    <TextBlock Grid.Row="2" Grid.Column="1" Text="{Binding LayoutScale}" Style="{StaticResource RightAlign}" />
                    <TextBlock Grid.Row="3" Text="Window size:" />
                    <TextBlock Grid.Row="3" Grid.Column="1" Text="{Binding WindowSize}" Style="{StaticResource RightAlign}" />
                </Grid>
            </StackPanel>
        </ScrollViewer>
    </Grid>
</UserControl>
